package com.roger.homecenterscreen.data.api

import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * 经纬度转城市区域名称API服务
 * 使用 https://cn.apihz.cn/api/other/jwjuhe2.php
 */
interface CoordinateLocationApiService {
    
    @GET("api/other/jwjuhe2.php")
    suspend fun getLocationByCoordinates(
        @Query("id") id: String,
        @Query("key") key: String,
        @Query("lon") longitude: String,
        @Query("lat") latitude: String
    ): Response<CoordinateLocationResponse>
}

/**
 * 经纬度转地址响应数据模型
 */
data class CoordinateLocationResponse(
    val success: Boolean? = null,
    val code: Int? = null,
    val message: String? = null,
    val data: CoordinateLocationData? = null
)

data class CoordinateLocationData(
    val country: String? = null,
    val province: String? = null,
    val city: String? = null,
    val district: String? = null,
    val street: String? = null,
    val address: String? = null,
    val formatted_address: String? = null
) 